#include "encoder.h"
#include "tim.h"
#include "beep.h"
#include "fan.h"



ENCODER encoder;

void encoder_thread_entry(void *parameter)
{
    HAL_TIM_Encoder_Start(&htim3, TIM_CHANNEL_1);
    HAL_TIM_Encoder_Start(&htim3, TIM_CHANNEL_2);

    while (1)
    {
        /* code */
        encoder.cnt = __HAL_TIM_GET_COUNTER(&htim3);
        encoder.cnt_speed = encoder.cnt - encoder.cnt_temp;
        encoder.cnt_temp = encoder.cnt;
        rt_thread_mdelay(100);

    }
    
}
